import request from '@/axios/request'
import url from '@/axios/url'
const { mesUrl, adminUrl, wmsUrl } = url()
// 导出url
export const exportUrl = `${mesUrl}mesTmOrder/export`


/**
 * 分页
 * @param data
 * @returns {*|Promise<*>}
 */
export function mesTmOrderDelete(data = {}) {
  return request({
    url: `${mesUrl}mesTmOrder/${data}`,
    method: 'delete',
    data
  })
}

export function tmOrderPage(data = {}) {
  return request({
    url: `${mesUrl}mesTmOrder/pageNew`,
    method: 'get',
    params: data
  })
}

export function reportsView(data = {}) {
  return request({
    url: `${mesUrl}mesTmOrder/reportsView`,
    method: 'get',
    params: data
  })
}

export function tmOrderMainPicUpdate(data = {} ){
  return request({
    url: `${mesUrl}mesTmOrder/updateMainPic`,
    method: 'post',
    data: data
  })
}

export function tmOrderSubPicUpdate(data = {} ){
  return request({
    url: `${mesUrl}mesTmOrder/updateSubPic`,
    method: 'post',
    data: data
  })
}

export function tmOrderReportCreate(data = {} ){
  return request({
    url: `${mesUrl}mesTmOrder/reportFile/c`,
    method: 'post',
    data: data
  })
}

export function tmOrderReportPush(data = {} ){
  return request({
    url: `${mesUrl}mesTmOrder/reportFile/p`,
    method: 'post',
    data: data
  })
}

export function tmOrderMainDataUpdate(data = {} ){
  return request({
    url: `${mesUrl}mesTmOrder/updateOnlyMainTb`,
    method: 'put',
    data: data
  })
}

export function tmOrderInfo(id = "") {
  return request({
    url: `${mesUrl}mesTmOrder/infoPc/${id}`,
    method: "get",
  });
}

export function preparationDelete(id = "" ){
  return request({
    url: `${mesUrl}mesTmPreparationData/${id}`,
    method: 'put',
  })
}

